package com.yang.proxy.dynamicproxy.cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author yang
 * @version 0.1
 * @date 2019/4/12
 */
public class CglibProxy implements MethodInterceptor {


    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("寻找房源");
        Object invoke = methodProxy.invokeSuper(o, objects);
        System.out.println("签署合同");
        return invoke;
    }
}
